class Solution(object):
    def jump(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        result = 0
        nums_len = len(nums)
        index = 0
        while index < nums_len - 1:
            num = nums[index]
            if num + index >= nums_len - 1:
                result += 1
                return result
            else:
                i = index + 1
                max_index = i
                while i <= index + num:
                    if nums[i] + i > nums[max_index] + max_index:
                        max_index = i
                    i += 1
                index = max_index
                result += 1
        return result
